/* $RCSFile: logoff.aspx.cs $
 * Apache license v2 2011 by Christian Surieux
 * $Source: ?/AddonNice/Secure/logoff.aspx.cs $
 * $log$
 * Revision 20 2010/08/09 10:51:22  christian.surieux
 *   Added Log comment to all .aspx .ascx .master files
 * Revision 19 2010/08/09 09:44:00  christian.surieux
 *   Added Log to cs sources files
 * Revision 6 2010/08/06 19:56:26  christian.surieux
 *   Added Log to All cs files
 */

using System;
using System.Collections;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.HtmlControls;
using System.Web.Security;

using AddonNice.Authentication;
using AddonNice.Security;
using AddonNice.Configuration;
using AddonNice.UI;
using AddonNice.UI.WebControls;
using AddonNice.Core;
using AddonNice.Diagnostics;
using AddonNice.Helpers;
using AddonNice.Country;

using AddonNice.CRMWrapper;

using Trace2 = System.Diagnostics.Trace;

namespace AddonNice.Secure
{
    /// <summary>
	/// The Logoff page is responsible for signing out a user 
	/// from the cookie authentication, and then redirecting 
	/// the user back to the portal home page.
	/// This page is executed when the user	clicks 
	/// the Logoff button at the top of the page.
    /// </summary>
    public partial class Logoff :  StaticStdAuxPage
    {
        public override int PageID
		{
			get
			{   return StStr.PageLogoffID; }
		}

        protected void Page_Load(object sender, System.EventArgs e)
        {
            if (PageTraceSwitch.Sw.TraceVerbose)
                Trace2.WriteLine("[V]Logoff Page_Load BEG.", PageTraceSwitch.Sw.Info);
			PortalSecurity.SignOut();
        }

		override protected void OnInit(EventArgs e)
		{
            if (PageTraceSwitch.Sw.TraceVerbose)
                Trace2.WriteLine("[V]Logoff OnInit BEG.", PageTraceSwitch.Sw.Info);
			InitializeComponent();
			base.OnInit(e);
            if (PageTraceSwitch.Sw.TraceVerbose)
                Trace2.WriteLine("[V]Logoff OnInit END.", PageTraceSwitch.Sw.Info);
		}

		private void InitializeComponent() 
		{    
            Load                                    +=  new EventHandler(Page_Load);
		}
    }
}
